﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace WpfPdfReader
{
    /// <summary>
    /// App.xaml 的交互逻辑
    /// </summary>
    public partial class App : Application
    {
        public App()
        {
            this.Startup += new StartupEventHandler(App_Startup);
        }

        void App_Startup(object sender, StartupEventArgs e)
        {
            MainWindow mainWindow = new MainWindow();
            this.MainWindow = mainWindow;

            if (e.Args != null && e.Args.Length > 0)
            {
                string userPdfFile = e.Args[0];
                string ext = System.IO.Path.GetExtension(userPdfFile);
                if (ext.ToLower() == ".pdf")
                {
                    mainWindow.PdfFileName = userPdfFile;
                }
            }
            mainWindow.Show();
        }
    }
}
